package com.knife.blog.logic;

import com.knife.web.ActionContext;
import com.knife.web.tools.ActiveUser;
import com.knife.web.tools.IActiveUser;
import com.knife.web.tools.ICurrentUser;

public class CurrentUser implements ICurrentUser {
	public IActiveUser getCurrentUser() {		
		ActiveUser user=new ActiveUser();
		//user.setUserName("admin");
		user=(ActiveUser)ActionContext.getContext().getSession().getAttribute("bloguser");
		return user;
	}
	
	public static IActiveUser getActiveUser()
	{	
		CurrentUser cu=new CurrentUser();
		IActiveUser user=null;
		try{
			user=cu.getCurrentUser();
		}catch(Exception e){}
		return user;
	}
}
